package com.jiangong.controller;

import com.jiangong.entity.*;
import com.jiangong.service.InformationOverviewService;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@RestController
//@Api(tags = "信息总览")
@RequestMapping("/InformationOverview")
public class InformationOverviewController {
    @Autowired
    private InformationOverviewService informationOverviewService;

//    @ApiOperation(value = "气象站")
    @RequestMapping("/Weather")
    @ResponseBody
    public Result Weather(Weather weather) {
        List<Weather> list= informationOverviewService.Weather(weather);
        return Result.success(list);
    }

//    @ApiOperation(value = "历史发电频率")
    @RequestMapping("/HPowerOut")
    @ResponseBody
    public Result HPowerOut(HPowerOut hPowerOut) {
        List<HPowerOut> list = informationOverviewService.HPowerOut(hPowerOut);
        return Result.success(list);
    }

//    @ApiOperation(value = "实时发电频率")
    @RequestMapping("/TPowerOut")
    @ResponseBody
    public Result TPowerOut(TPowerOut tPowerOut) {
        List<TPowerOut> list = informationOverviewService.TPowerOut(tPowerOut);
        return Result.success(list);
    }

//    @ApiOperation(value = "总实时发电频率")
    @RequestMapping("/TPowerOutSum")
    @ResponseBody
    public Result TPowerOutSum(TPowerOutSum tPowerOutSum) {
        List<TPowerOutSum> list = informationOverviewService.TPowerOutSum(tPowerOutSum);
        return Result.success(list);
    }

//    @ApiOperation(value = "电池组功率")
    @RequestMapping("/PowerBarry")
    @ResponseBody
    public Result PowerBarry(PowerBarry powerBarry) {
        List<PowerBarry> list = informationOverviewService.PowerBarry(powerBarry);
        return Result.success(list);
    }

//    @ApiOperation(value = "用电功率历史")
    @RequestMapping("/HPowerin")
    @ResponseBody
    public Result HPowerin(HPowerin hPowerin) {
        List<HPowerin> list = informationOverviewService.HPowerin(hPowerin);
        return Result.success(list);
    }

//    @ApiOperation(value = "用电功率实时")
    @RequestMapping("/TPowerin")
    @ResponseBody
    public Result TPowerin(TPowerin tPowerin) {
        List<TPowerin> list = informationOverviewService.TPowerin(tPowerin);
        return Result.success(list);
    }
    @GetMapping("/weatherApi")
//    @ApiModelProperty("获取天气信息")
    @ResponseBody
    private Result weatherApi() throws IOException {
        WeatherAPI weather = informationOverviewService.weatherApi();
        return Result.success(weather);
    }
}